import java.util.*;


public class Test {
    public static void main(String[] args) {
        MySingleList mySingleList = new MySingleList();
        mySingleList.addLast(1);
        mySingleList.addLast(2);
        mySingleList.addLast(3);
        mySingleList.addLast(4);
        mySingleList.display3(mySingleList.head);
        System.out.println();
        mySingleList.display4();

    }

    public static void main66(String[] args) {
        LinkedList<String> linkedList = new LinkedList<>();
        linkedList.add("hello");
        linkedList.add("abc");
        linkedList.add("def");
        linkedList.add("ok");
        System.out.println(linkedList);
        System.out.println("===========");
        for (String x : linkedList) {
            System.out.println(x);
        }
        System.out.println("===========");
        ListIterator<String> it = linkedList.listIterator();
        while (it.hasNext()) {
            System.out.println(it.next());
        }

        System.out.println("=====反向======");
        ListIterator<String> it2 = linkedList.listIterator(linkedList.size());
        while (it2.hasPrevious()) {
            System.out.println(it2.previous());
        }


        ArrayList<String> list = new ArrayList<>();

        LinkedList<String> linkedList2 = new LinkedList<String>(list);


    }
}